#include "gtest/gtest.h"

#include "stack.h"

using namespace algo;

// push test
TEST(PushTest, HandlesPush)
{
	Stack<int> stack;
	stack.push(123);
    EXPECT_EQ(stack.size(), 1);
}

// push test
TEST(PushTest2, HandlesPush)
{
	Stack<int> stack;
	stack.push(123);
	int val = 0;
	bool ret = stack.pop(val);
    EXPECT_EQ(stack.size(), 0);
}

// push test
TEST(PushTest3, HandlesPush)
{
	Stack<int> stack;
	int val = 0;
	bool ret = stack.pop(val);
    EXPECT_EQ(ret, false);
}

// push test
TEST(PushTest4, HandlesPush)
{
	Stack<int> stack;
	int val = 0;
	stack.push(123);
	stack.push(234);
	bool ret = stack.pop(val);
    EXPECT_EQ(stack.size(), 1);
}

// push test
TEST(PushTest5, HandlesPush)
{
	Stack<int> stack;
	int val = 0;
	stack.push(123);
	stack.push(234);
	bool ret = stack.pop(val);
    EXPECT_EQ(val, 234);
}

// push test
TEST(PushTest6, HandlesPush)
{
	Stack<int> stack;
	int val = 0;
	stack.push(123);
	stack.push(234);
	bool ret = stack.pop(val);
	ret = stack.pop(val);
    EXPECT_EQ(val, 123);
}

// push test
TEST(PushTest7, HandlesPush)
{
	Stack<int> stack;
	int val = 0;
	stack.push(123);
	stack.push(234);
	bool ret = stack.pop(val);
	ret = stack.pop(val);
    EXPECT_EQ(stack.size(), 0);
}

int main(int argc, char **argv)
{
	::testing::InitGoogleTest(&argc, argv);
	return RUN_ALL_TESTS();
}